package cn.aitstone.basic.config;

import cn.aitstone.basic.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
 * @Description: 登录拦截器配置类
 * @Author: Sheldon
 * @Version: 1.0
 * @Date:  2022/7/7 16:25
 */
@Configuration
public class LoginConfig implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/login/**")
                .excludePathPatterns("/verifyCode/**")
                .excludePathPatterns("/shop/settlement")
                .excludePathPatterns("/user/register/**")
                .excludePathPatterns("/fastDfs/**");


    }
}
